<?php
	include("session.inc");
  	include("dbconn.inc");
	include("dbfuc.inc");
	
	$logname=$HTTP_POST_VARS["membername"];
	$password=$HTTP_POST_VARS["password"];
	//$bid=$HTTP_POST_VARS["i"];
	$id=0;
	$username="";
	$uid=0;
	$renewalno=0;
	$errormsg="";
	$errorstep=false;
	if($logname==null) 
		$logname="";
	if($password==null) 
	  	$password="";
	$today=date('Y-m-d');
				/* check user is exist in admin */
	$query  = "select c_admin_user,c_admin_password,n_id from  admin where c_admin_user = '$logname' and c_admin_password='$password'  ";
//	echo $query;
	$result = mysql_query($query); 
	$numR   = mysql_num_rows($result);
	//echo $numR;
	if ($numR == 1) 
	{ 
		$numR=$numR-1;
		$username=mysql_result($result,$numR,"c_admin_user");
		$adminid=mysql_result($result,$numR,"n_id");
				//echo "login was successfull....";
				$errorstep=true;
				$_SESSION["adminuser"]=$username;
				$_SESSION["adminid"]=$adminid; 
				$_SESSION["admindb"]=$db; 
	} 
	else 
	{  
		$errorstep=false;
		$errormsg="Invalid User Name/Password";
	}  
	
	if($errorstep==true)
	{
		header("location:login_true.php");
	}
	else
	{
		header("location: index.php?error=$errormsg");
		
	}

?>